//
//  SHSeaDetailCell.m
//  UI_CarHome
//
//  Created by dllo on 15/11/7.
//  Copyright (c) 2015年 沈浩. All rights reserved.
//

#import "SHSeaDetailCell.h"
#import "SHHandle.h"
#define CWIDT self.contentView.frame.size.width
#define CHEIG self.contentView.frame.size.height
@implementation SHSeaDetailCell

- (void)dealloc
{
    [_imgImageView release];
    [_nameLabel release];
    [_pricebetweenLabe release];
    [_levelnameLabel release];
    [super dealloc];
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createView];
    }
    return self;
}

- (void)createView {
    self.imgImageView = [[UIImageView alloc] init];
    [self.contentView addSubview:self.imgImageView];
    [_imgImageView release];
    
    self.nameLabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.nameLabel];
    [_nameLabel release];
    self.nameLabel.textColor = TEXTCOLOR;
    
    self.pricebetweenLabe = [[UILabel alloc] init];
    [self.contentView addSubview:self.pricebetweenLabe];
    [_pricebetweenLabe release];
    self.pricebetweenLabe.textColor = [UIColor redColor];
    
    self.levelnameLabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.levelnameLabel];
    self.levelnameLabel.textColor = [UIColor grayColor];
    [_levelnameLabel release];
}
- (void)layoutSubviews {
    [super layoutSubviews];
    
    self.imgImageView.frame = CGRectMake(5, 5, CWIDT / 4, CHEIG - 10);
    self.nameLabel.frame = CGRectMake(5 + CWIDT / 4 + 5, 5, CWIDT * 2 / 3, CHEIG / 4);
    self.levelnameLabel.frame = CGRectMake(10 + CWIDT / 4, CHEIG * 3 / 4, CWIDT / 4, 20);
    self.pricebetweenLabe.frame = CGRectMake(CWIDT * 3 / 4, CHEIG * 3 / 4, CWIDT / 4, 20);
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
